// 导入 vue-router 包
import VueRouter from 'vue-router';
// 导入对应的路由组件
import HomeContainer from './Components/tabbar/HomeContainer.vue';
import MemberContainer from './Components/tabbar/MemberContianer.vue';
import ShopcarContainer from './Components/tabbar/ShopcarContainer.vue';
import SearchContainer from './Components/tabbar/SreachContainer.vue';
import NewsList from './Components/news/newsList.vue';
import NewsInfo from './components/news/NewsInfo.vue';
import PhotoList from './Components/photos/PhotoList.vue';
import PhotoInfo from './Components/photos/PhotoInfo.vue';
import GoodsList from './Components/goods/GoodsList.vue';
import GoodsInfo from './Components/goods/GoodsInfo.vue';
import Goodsdesc from './Components/goods/Goodsdesc.vue';
import GoodsComment from './Components/goods/GoodsComment.vue';


// 创建路由对象
var router = new VueRouter({
    routes:[ //配置路由规则
        { path: '/',redirect: '/home'},
        { path: '/home' , component: HomeContainer },
        { path: '/member' , component: MemberContainer },
        { path: '/shopcar' , component: ShopcarContainer },
        { path: '/search' , component: SearchContainer },
        { path: '/home/newsList', component: NewsList },
        { path: '/home/newsinfo/:id', component: NewsInfo },
        { path: '/home/photoList', component: PhotoList },
        { path: '/home/photoInfo/:id', component: PhotoInfo },
        { path: '/home/GoodsList', component: GoodsList },
        { path: '/home/GoodsInfo/:id', component: GoodsInfo, name: 'GoodsInfo' },
        { path: '/home/Goodsdesc/:id', component: Goodsdesc, name: 'Goodsdesc' },
        { path: '/home/GoodsComment/:id', component: GoodsComment, name: 'GoodsComment' },
    ],
    linkActiveClass: 'mui-active', //覆盖 默认高亮的类 默认的类名：router-link-active
});
// 通过 export default 将该路由对象暴露出去
export default router;